package Month07.day27.test1;

import java.util.HashSet;
import java.util.Iterator;

public class main {
    public static void main(String[] args) {
        HashSet<Person> people = new HashSet<>();
        Person person = new Person("袁康",23);
        Person person1 = new Person("杨政",23);
        Person person2 = new Person("喻温勤",23);
        Person person3 = new Person("喻温勤",23);
        people.add(person);
        people.add(person1);
        people.add(person2);
        people.add(person3);
        Iterator<Person> iterator = people.iterator();
        while (iterator.hasNext()){
            Person next = iterator.next();
            System.out.println(next);
        }
        System.out.println("------------------------");
        for (Person person4 : people) {
            System.out.println(person4);
        }
    }
}
